<?php

namespace my;
/**
 * 测试文件
 */
class Test
{
    static private $count = 0;
    static private $instance = null;

    private function __construct($options = [])
    {

    }

    static public function getInstance($config = [])
    {
        //判断$instance是否是唯一的对象
        //没有则创建
        if (!self::$instance instanceof self) {
            self::$instance = new self($config);
        }
        return self::$instance;
    }

    static public function increase() {
        self::$count++;
    }

    static public function get() {
        return self::$count;
    }

    public function say() {
        $this->increase();
        $this->increase();
        $this->increase();
        $this->increase();
        pp($this->get());
        echo "say Hello!";
    }

    public function add() {
        return "add()";
    }

}